package com.mzz.structure.decorator;

import java.io.FileNotFoundException;

/**
 *  JDK的IO类里面
 *
 * Reader fr = new FileReader();
 *
 * BufferReader buff = new BufferedReader(fr); //就是装饰器的例子
 *
 *
 * @author xushijian
 * @date 18/6/7 下午2:20
 */
public class Test {

    public static void main(String[] args) throws FileNotFoundException {

        Shape circle = new Circle();
        Shape redCircle = new RedShapeDecorator(new Circle());

        circle.draw();

        redCircle.draw();

        System.out.println("------------------");

        Shape rectangle = new Rectangle();
        Shape redRectancle = new RedShapeDecorator(rectangle);

        rectangle.draw();

        redRectancle.draw();


        //装饰器例子

//        Reader fr = new FileReader("aaa");
//        BufferedReader bufferedReader = new BufferedReader(fr);



    }
}
